from PyQt6.QtWidgets import QWidget, QGridLayout
from PyQt6.QtCore import Qt
from ..left_main.left_panel import LeftPanel
from ..right_main.right_panel import RightPanel

class MainLayout(QWidget):
    def __init__(self):
        super().__init__()
        self.setObjectName("contentWidget")
        
        # 创建网格布局
        self.layout = QGridLayout()
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.layout.setSpacing(0)
        
        # 初始化面板
        self.init_panels()
        
        # 设置布局
        self.setLayout(self.layout)
        
    def init_panels(self):
        # 创建左侧面板
        self.left_panel = LeftPanel()
        self.left_panel.setObjectName("leftPanel")
        
        # 创建右侧面板
        self.right_panel = RightPanel()
        self.right_panel.setObjectName("rightPanel")
        
        # 添加到网格布局
        # 参数：widget, row, column, rowSpan, columnSpan
        self.layout.addWidget(self.left_panel, 0, 0, 1, 7)  # 占7份
        self.layout.addWidget(self.right_panel, 0, 7, 1, 3)  # 占3份